from remoteDB import ArticleDB
from iData import IData


if __name__ == '__main__':
    bot = IData()
    db = ArticleDB()
    cursor = db.conn.cursor()
    cursor.execute('select * from search_key where max_page=-1')
    keys = cursor.fetchall()
    for key in keys:
        res = bot.get_ixueshu_article(key[1])
        cursor.execute(f"update search_key set used={res} where search_key.key='{key[1]}'")
        db.conn.commit()
